import { defineStore } from 'pinia'
import { ref } from 'vue'
//import { userGetHistoryNewsService } from '@/api/news'
//用户模块token setToken removeToken
export const useNewsStore = defineStore('big-News', () => {
  const newsList = ref([])

  const initNewsList = (list) => {
    //const history = await userGetHistoryNewsService()
    //newsList.value = history.data.data
    //newsList.value = userGetHistoryNews()
    newsList.value = list
  }
  const addNewsList = (news) => {
    newsList.value.push(news)
    console.log('现在的历史记录是：')
    console.log(newsList.value)
  }
  return {
    newsList,
    addNewsList,
    initNewsList
  }
})
